fix(tui): free capital G for typing, move jump-to-latest to ^G - #22
Merged
Conversation
The G/End binding was guarded by an empty input, which protected typing G mid-draft but swallowed the keystroke when the input was empty — a prompt could never start with a capital G. G now always types into the input. Jump-to-latest moves to ^G (works even with a draft); End keeps the jump only with an empty input so its cursor-movement meaning inside a draft is preserved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The jump-to-latest binding
case "G", "end":was guarded bym.ta.Value() == "". That protected typingGmid-draft, but with an empty input the keystroke was swallowed by the jump — a prompt could never start with a capital "G" ("Go ahead…" → nothing typed).Fix
G^GEndChanges
internal/tui/model.go— split the binding:ctrl+gjumps unconditionally,endkeeps the empty-input guardinternal/tui/view.go/internal/tui/commands.go— footer hint and/helpentry now show^Ginternal/tui/promptflow_test.go— regression coverage:Gtypes even on an empty input,^Gjumps without disturbing a draft,Endkeeps both meaningsREADME.md— key-binding table syncedVerification
make fmt✓ ·make vet✓ ·make lint→ 0 issues ✓ ·make test(race) — all packages green ✓